package mn.idax.exchange.otc.service;

import mn.idax.exchange.otc.domain.capital.CapitalAPIParamsDTO;
import mn.idax.exchange.otc.entity.Account;
import mn.idax.exchange.otc.entity.OTCOrder;
import mn.idax.exchange.otc.vo.AccountFeeDTO;

import java.util.List;

/**
 * Create by jack_huang on 2018/8/15
 */
public interface AccountService {

//    Account getAccountByUserId(Integer userId);

    //冻结资金
    int forzenUserAccount(AccountFeeDTO accountFeeDTO);

    //通用解冻用户部分资金
    int unforzenUserAccountCommon(OTCOrder otcOrder);

    //解冻用户部分资金 + 更改订单状态为取消 订单状态为过期和取消时调用
    void unforzenUserAccountPayTimeOut(List<OTCOrder> otcOrders);

    Account getAccountByCoinIdAndUserId(Integer userId, Integer coinid);

    //订单完成时调用 买家币进买家账户
    Boolean transferAccounts(String orderNum);

    Boolean transferAccountsByOrder(OTCOrder order);

    //冻结手续费
    int forzenServiceCharge(AccountFeeDTO accountFeeDTO);

    //解冻手续费
    int unforzenServiceCharge(AccountFeeDTO accountFeeDTO);

    //收取手续费
    int getServiceCharge(AccountFeeDTO accountFeeDTO);

    /**
     * 功能描述:
     * 校验用户币种钱包信息，如不存在自动初始化币种钱包数据
     *
     * @param:
     * @return:
     * @auther: dison
     * @date: 2018/8/28 11:22
     */
    Account insertAccountCoinByVerifyAccount(Integer userId, Integer coinId);


    boolean unforzenUserAccountPayTimeOut(OTCOrder otcOrder, CapitalAPIParamsDTO capitalAPIParamsDTO) throws Exception;
}
